import Mock from 'mockjs'
import { userId } from '.././user/index.js'

Mock.mock('/api/shippings', 'post', {
  "status|1": [0, 10],
  "msg": "新建地址成功",
  "data": {
    "shippingId": 10
  }
})
Mock.mock('/api/shippings/10', 'get', {
  "status": 0,
  "data": {
    "id": 4,
    "userId": userId,
    "receiverName": "河畔一角",
    "receiverPhone": "010",
    "receiverMobile": "18688888888",
    "receiverProvince": "北京",
    "receiverCity": "北京市",
    "receiverDistrict": "海淀区",
    "receiverAddress": "中关村",
    "receiverZip": "100000",
    "createTime": new Date().getTime(),
    "updateTime": new Date().getTime()
  }
})
Mock.mock('/api/shippings/10', 'delete', {
  "status": 0,
  "msg": "删除地址成功"
})
Mock.mock('/api/shippings/10', 'put', {
  "status|1": [0, 10],
  "msg": "更新地址成功"
})
Mock.mock('/api/shippings', 'get', {
  "status": 0,
  "data": {
    "pageNum": 1,
    "pageSize": 10,
    "size": 2,
    "orderBy": null,
    "startRow": 1,
    "endRow": 2,
    "total": 2,
    "pages": 1,
    "list": [
      {
        "id": 4,
        "userId": userId,
        "receiverName": "河畔一角",
        "receiverPhone": "010",
        "receiverMobile": "18688888888",
        "receiverProvince": "北京",
        "receiverCity": "北京市",
        "receiverDistrict": "海淀区",
        "receiverAddress": "中关村",
        "receiverZip": "100000",
        "createTime": new Date().getTime(),
        "updateTime": new Date().getTime()
      },
      {
        "id": 5,
        "userId": userId,
        "receiverName": "AAA",
        "receiverPhone": "010",
        "receiverMobile": "18688888888",
        "receiverProvince": "北京",
        "receiverCity": "北京市",
        "receiverDistrict": "海淀区",
        "receiverAddress": "中关村",
        "receiverZip": "100000",
        "createTime": new Date().getTime(),
        "updateTime": new Date().getTime()
      }
    ],
    "firstPage": 1,
    "prePage": 0,
    "nextPage": 0,
    "lastPage": 1,
    "isFirstPage": true,
    "isLastPage": true,
    "hasPreviousPage": false,
    "hasNextPage": false,
    "navigatePages": 8,
    "navigatepageNums": [
      1
    ]
  }
})